Easy to Create, Easy to Change - Easy to use!

Support::

in groups



Parameters


Returns/Result


Examples


Reference

in groups

Type

Grouping Operator

Purpose

The in groups operator groups records and generates statistical totals for each group if any other statistic is requested by the query.

Note: the variation ?in groups with group-totals? is included for compatibility with previous version of DataEase. Either version will include statistics if they are required

Syntax

FIELDNAME in groups [with group-totals] ;

Usage

The in groups operator can be used only on list items following the list records command. It cannot be used with the enter a record, modify records, or delete records commands.

In the procedure output, the group identifier appears only once at the beginning of a group. If statistics are specified for any output fields, group subtotals for those fields are included in the output.

An item to be processed in groups with group-totals should be listed before all other output items in a script, including items to be sorted in order. When a field is listed in groups with group-totals, DataEase also sorts the groups in order (e.g., when grouping MEMBERS by STATE, all California members are listed before any Colorado members).

 

Caution

Grouping operators cannot be used with the all relational operator (i.e., if RESERVATIONS is the Primary table, you cannot use the query statement: all MEMBERS STATE in groups.

Example

for MEMBERS ;

list records

STATE in groups ;

LASTNAME in order ;

TOTALDUE : item sum .

end

 

This script tells DataEase: (1) Process all MEMBERS records with the same value in the STATE field as a group, (2)display the group identifier (STATE) once at the beginning of each group, (3) within each group, arrange the members alphabetically by LAST NAME, and (4) list each member's TOTAL DUE, the subtotal for each STATE group, and the sum of all the TOTAL DUE amounts combined. The output from this query might look as follows:

 

 

State

Last Name

Total Due

...

...

...

DC

 

 

 

Dowling

$115.00

 

Schmidt

$85.00

 

Spinelli

$100.00

 

Group Total:

$300.00

DE

 

 

 

Gross

$35.00

 

Stromboulis

$70.00

 

Group Total:

$105.00

...

...

...

 

Grand Total:

$405.00

 

See Also


On the forum about in groups

ExecDQL and in groups

Hi folks,in the last days I have been testing the use of MemoExecDQL / ExecDQL functions. It seems very powerful and I would like to use it instead the "null printer hack" to speed up and streamline my application. But during my tests I noticed...

Product: Dataease [{8}]FIVE. Written by George Washington 30/05/14 at 14:55:58

Re:ExecDQL and in groups

Is anybody in there?...

Product: Dataease [{8}]FIVE. Written by George Washington 11/06/14 at 06:31:28

Re:ExecDQL and in groups

Sorry for the late reply. We are currently working full out on 8.2 where DQL will be further enhanced.ExecDQL is DQL from "future" DataEase and is not derived from the existing DQL in DFW. Somewhere along the line someone "misunderstood" DQL a...

Product: Dataease [{8}]FIVE. Written by Mr. DataEase 11/06/14 at 11:02:44

Listing records in groups with a count.

Hi all, Say I have a table called Cars with the fields Year, Make & Model. How do I count the number of records when listing the Year field in groups? The script below gives me the year in groups but say there are 25 records with the y...

Product: Dataease [{8}]FIVE. Written by Bolt-on-Trailers 30/06/23 at 19:48:52

Re:Listing records in groups with a count.

for cars;list recordsyear in group with group totals ;cars : Count .Check script as done from memory :-)...

Product: Dataease [{8}]FIVE. Written by Josef Vella 05/07/23 at 13:59:03

Re:Re:Listing records in groups with a count.

Thank you very much for your help. If I use the following script I get the attached error. If I remove the "Cars : Count ." of the script it lists the year in groups but no totals. for Cars ; list records Year in groups...

Product: Dataease [{8}]FIVE. Written by Bolt-on-Trailers 05/07/23 at 15:54:01

Re:Re:Re:Listing records in groups with a count.

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUsAAADwCAYAAACJzUacAAAgAElEQVR4nO3dfVxUdaI/8M8AKlk+3HYBDdpCHbEQcvMJ86G6a1PTlgU3Xkq/vSXsTgaVD7W/m5jIKhbVr9XsQcvZBde7v8zlt2iWTI6+bg9q4FMqyK44KnWDEtjbqpWiOHx/f5w5M+fMA3MGhhmCz/v18qUz58w533MGPn6fzjk...

Product: Dataease [{8}]FIVE. Written by DataEase 06/07/23 at 09:38:56

Re:Re:Re:Re:Listing records in groups with a count.

OK, but the following has this error when I try to save. What needs to change in the last line of the script?for Cars ;list records Year in groups with group-totals ;Cars : Count .<img src="data:image/png;base64,iVBO...

Product: Dataease [{8}]FIVE. Written by Bolt-on-Trailers 06/07/23 at 15:14:09

Re:Re:Re:Re:Re:Listing records in groups with a count.

The problem is that you have no field called Cars in the table.I guess you have one called Make.If you simply want the count of the year&nbsp; you can simply do&nbsp;for Cars;list recordsYear in groups ;Year :...

Product: Dataease [{8}]FIVE. Written by DataEase 07/07/23 at 19:08:23

On the blog about in groups